.\" -*- nroff -*-
.\" 
.\" Copyright (c) 2006 Carnegie Mellon University.  All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\"
.\" 1. Redistributions of source code must retain the above copyright
.\"    notice, this list of conditions and the following disclaimer. 
.\"
.\" 2. Redistributions in binary form must reproduce the above copyright
.\"    notice, this list of conditions and the following disclaimer in
.\"    the documentation and/or other materials provided with the
.\"    distribution.
.\"
.\" 3. The name "Carnegie Mellon University" must not be used to
.\"    endorse or promote products derived from this software without
.\"    prior written permission. For permission or any other legal
.\"    details, please contact  
.\"      Office of Technology Transfer
.\"      Carnegie Mellon University
.\"      5000 Forbes Avenue
.\"      Pittsburgh, PA  15213-3890
.\"      (412) 268-4387, fax: (412) 268-7395
.\"      tech-transfer@andrew.cmu.edu
.\"
.\" 4. Redistributions of any form whatsoever must retain the following
.\"    acknowledgment:
.\"    "This product includes software developed by Computing Services
.\"     at Carnegie Mellon University (http://www.cmu.edu/computing/)."
.\"
.\" CARNEGIE MELLON UNIVERSITY DISCLAIMS ALL WARRANTIES WITH REGARD TO
.\" THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
.\" AND FITNESS, IN NO EVENT SHALL CARNEGIE MELLON UNIVERSITY BE LIABLE
.\" FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
.\" AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
.\" OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\" 
.TH sasl_callbacks 3 "12 February 2006" SASL "SASL man pages"
.SH NAME
sasl_callbacks \- How to work with SASL callbacks

.SH SYNOPSIS
.nf
.B #include <sasl/sasl.h>

.fi
.SH DESCRIPTION

.B sasl_callbacks
are used when the application needs some information from the
application. Common reasons are getting for getting usernames and
passwords. A client MUST specify what callbacks they support in the
sasl_client/server_init() or sasl_client/server_new() calls. If an
authentication mechanism needs a callback that the application does
not state it supports it cannot be used. 

If a callback has an
.B id
parameter that should be checked to make sure you are giving the appropriate value.

If an application is using the client side of the library functions to handle the callbacks are not necessary. Instead the application may deal with callbacks via SASL_INTERACT's. See sasl_client_start/step() for more information.

The list of callbacks follows:

.SH Common Callbacks
.TP 0.8i
sasl_getopt_t
Get an option value
.TP 0.8i
sasl_log_t
Log message handler
.TP 0.8i
sasl_getpath_t
Get path to search for plugins (e.g. SASL mechanisms)
.TP 0.8i
sasl_verifyfile_t
Verify files for use by SASL
.TP 0.8i
sasl_canon_user_t
Username canonicalization function.

.SH Client-only Callbacks
.TP 0.8i
sasl_getsimple_t
Get user/language list
.TP 0.8i
sasl_getsecret_t
Get authentication secret
.TP 0.8i
sasl_chalprompt_t
Display challenge and prompt for response
.TP 0.8i
sasl_getrealm_t
Get the realm for authentication

.SH Server-only Callbacks
.TP 0.8i
sasl_authorize_t
Authorize policy callback
.TP 0.8i
sasl_server_userdb_checkpass_t
verify plaintext password
.TP 0.8i
sasl_server_userdb_setpass_t
set plaintext password
.TP 0.8i
sasl_getconfpath_t
Get path to search for SASL configuration file (server side only). New in SASL 2.1.22.

.SH "RETURN VALUE"

SASL callback functions should return SASL return codes. See sasl.h for a complete list. SASL_OK typically indicates success.

.SH "CONFORMING TO"
RFC 4422

.SH "SEE ALSO"
sasl(3), sasl_errors(3), sasl_authorize_t(3), sasl_log_t(3), sasl_getpath_t(3),
sasl_getconfpath_t(3), sasl_verifyfile_t(3), sasl_canon_user_t(3), sasl_getsimple(3),
sasl_getsecret_t(3), sasl_chalprompt_t(3), sasl_getrealm_t(3),
sasl_authorize_t(3), sasl_server_userdb_checkpass_t(3),
sasl_server_userdb_setpass_t(3)
